-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HACKTOBERFEST] Update to pi4j-v2 & Multi-Chip support #1
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
including temporary reference to local snapshot version of the pi4j-mock-plugin.
this means that the class is updated to pi4j V2 and supports multiple chips on the same SPI bus in one single commit. Commit isn't functional (still depends on pi4j Component parents log() and delay() methods) but useful to see what has been affected.
gradle build now successfully compiles
Mainly used to assertArrayEquals without having to punch in hundreds of magic numbers. Also used to fill the MockSpi.raw data buffer with prepared data.
add Mockito dependency
…s() factory method.
…oader doesn't support cross-workflow artifact sharing
…ne of those kind of method sets.
NOTE: the current implementation doesn't allow for multiple separate instantiations of chips or chip arrays with the static factory methods because the SPI id is hardcoded. Will have to fix during refactoring. That's the reason method coverage isn't 100%.
…Makes it way more configurable. NOTE: the added flexibility might pose a difficulty obstacle for the user. Could maybe be mitigated by providing examples.
This removed some pretty ugly code duplication. yay!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
multipleNewOnSameBus()
factory method. This means multiple chips can now be used on the same bus, using hardware address pins.transfer()
method, see #301. Since those changes aren't in maven central yet I bodged together a workaround solution with github actions, see the [...]-SNAPSHOT branch)NOTE:
The Interface for the static factory methods changed:
Why
We used this library (or my updated version of it) extensively in our project, so by the end I was quite familiar with it. When I heard of Hacktoberfest, I thought this was the perfect opportunity to contribute what I can offer.

@Ro5bert I would appreciate it if you could label this PR "hacktoberfest-accepted" (if you like it, that is), that way it counts towards my hacktoberfest contributions.
Taken from https://hacktoberfest.com/participation/
Thanks!
Feel free to provide feedback and I'll try to get to it asap.
Have a good one!
Cheers!
-MNG